From 1d80237d14c9bf7be01325765c35b5809ce0030e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 11 Jan 2011 19:28:22 +0000 Subject: [PATCH] libxl: config parser: do not segfault in some error paths In error paths, xlu__cfg_set_free can be called on NULL. So check for that rather than segfaulting. Signed-off-by: Ian Jackson --- tools/libxl/libxlu_cfg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/libxl/libxlu_cfg.c b/tools/libxl/libxlu_cfg.c index 864a723009..1ade7eacda 100644 --- a/tools/libxl/libxlu_cfg.c +++ b/tools/libxl/libxlu_cfg.c @@ -93,6 +93,7 @@ int xlu_cfg_readdata(XLU_Config *cfg, const char *data, int length) { void xlu__cfg_set_free(XLU_ConfigSetting *set) { int i; + if (!set) return; free(set->name); for (i=0; invalues; i++) free(set->values[i]); -- 2.30.2